//1. 导入vue-router相关函数
import {createRouter, createWebHashHistory} from "vue-router"

import Main from "../views/main.vue";
import Game from "../views/game.vue";

// 2.路由规则
const routes = [{
    path: '/',
    redirect: '/main'
}, {
    path: "/main",
    name: "Main",
    component: Main
}, {
    path: "/game",
    name: "Game",
    component: Game
}
]
// 3.路由对象实例化
const router = createRouter({
    history: createWebHashHistory(),
    routes
})
// 暴露导出
export default router